package person.tanjinfu.jaegerexample;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.Random;
import java.util.concurrent.TimeUnit;


@RestController
public class JaegerExampleCalleeController {
    private Random random = new Random();

    @GetMapping
    public String hello() {
        try {
            TimeUnit.MILLISECONDS.sleep(random.nextInt(1000));// 模拟访问 database
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "Hello from callee. at: " + LocalDateTime.now();
    }


}
